.z-shape {
    display: grid;
    grid-template-columns: repeat(4, 30px);
    grid-template-rows: repeat(2, 30px);
}

.l-shape {
    display: grid;
    grid-template-columns: repeat(3, 30px);
    grid-template-rows: repeat(2, 30px);
}

.grid-container {
    position: relative;
    display: grid;
    grid-template-columns: repeat(10, 30px);
    grid-template-rows: repeat(20, 30px);
    border: 2px solid #333;
    width: 300px;
    height: 600px;
    box-sizing: border-box;
    margin-bottom: 20px;
    border-radius: 5px;
    overflow: hidden;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
    background-image: linear-gradient(90deg,
    transparent 29px,
    #333 29px,
    #333 30px),
    linear-gradient(0deg, transparent 29px, #333 29px, #333 30px);
    background-size: 30px 30px;

}

.grid-item {
    border: 1px solid #333;
    background-color: transparent;
    width: 30px;
    height: 30px;
    position: absolute;
    bottom: 0;
}

/* 以下代码无需修改 */
.cell {
    background-color: #3498db;
    border: 1px solid #2980b9;
    box-sizing: border-box;
}

.l-shape .cell:nth-child(1) {
    background-color: #e74c3c;
    border-color: #c0392b;
}

.l-shape .cell:nth-child(2) {
    background-color: #2ecc71;
    border-color: #27ae60;
}

.l-shape .cell:nth-child(3) {
    background-color: #f1c40f;
    border-color: #f39c12;
}

.l-shape .cell:nth-child(4) {
    background-color: #9b59b6;
    border-color: #8e44ad;
}

.z-shape .cell:nth-child(1),
.z-shape .cell:nth-child(2) {
    background-color: #e67e22;
    border-color: #d35400;
}

.z-shape .cell:nth-child(3),
.z-shape .cell:nth-child(4) {
    background-color: #f39c12;
    border-color: #d35400;
}


.l-shape {
    grid-template-areas:
        "a b c"
        "d e .";
}

.z-shape {
    grid-template-areas:
        "a b c d"
        "e f g h";
}

.z-shape {
    grid-template-areas:
        "a b c d"
        "e f g h";
}

.l-shape .cell:nth-child(1) {
    grid-area: a;
}

.l-shape .cell:nth-child(2) {
    grid-area: b;
}

.l-shape .cell:nth-child(3) {
    grid-area: c;
}

.l-shape .cell:nth-child(4) {
    grid-area: d;
}

.l-shape .cell:nth-child(5) {
    grid-area: e;
}

.z-shape .cell:nth-child(1) {
    grid-area: a;
}

.z-shape .cell:nth-child(2) {
    grid-area: b;
}

.z-shape .cell:nth-child(3) {
    grid-area: g;
}

.z-shape .cell:nth-child(4) {
    grid-area: h;
}

body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

.tetris-container {
    border: 2px solid #333;
    padding: 20px;
    background: linear-gradient(45deg, #000 25%, transparent 25%),
    linear-gradient(-45deg, #000 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #000 75%),
    linear-gradient(-45deg, transparent 75%, #000 75%);
    background-size: 30px 30px;
    background-color: #000;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    display: flex;
    flex-direction: row;
    align-items: flex-start;
}

.score-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-right: 20px;
}

.score {
    font-weight: bold;
    color: #fff;
    margin-bottom: 10px;
}

.level {
    font-weight: bold;
    color: #fff;
    margin-bottom: 10px;
}


.grid-item.type1 {
    background-color: #ff7f0e;
}

.grid-item.type2 {
    background-color: #1f77b4;
}

.grid-item.type3 {
    background-color: #2ca02c;
}

.grid-item.type4 {
    background-color: #d62728;
}

.grid-item.type5 {
    background-color: #9467bd;
}

.grid-item.type6 {
    background-color: #8c564b;
}

.grid-item.type7 {
    background-color: #e377c2;
}

.next-block {
    text-align: center;
    margin-top: 20px;
    color: #fff;
    width: 120px;
    margin-left: 20px;
}

.next-block .grid-container {
    border: 1px solid #333;
    width: 120px;
    height: 90px;
    border-radius: 5px;
    overflow: hidden;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
}